import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/pages/Home'
import About from '@/pages/About'
import News from '@/pages/News'
import Message from '@/pages/Message'

Vue.use(VueRouter)

export default new VueRouter({
  mode: 'history',
  // routes是route的复数，所以routes中要编写一组一组的路由规则（route）
  routes: [
    {
      path: '/home',
      component: Home,
      children:[
        {
          path:'news',
          component:News
        },
        {
          path:'message',
          component:Message
        }
      ]
    },
    {
      path: '/about',
      component: About
    }
  ]
})